<?php
class PDF {
	function viewAll() {
		$query = "select * from dt_pdf";
		$data = mysql_query($query);
		return $data;
	}
	
	function selectSingle($id) {
		$query = "select * from dt_pdf where pdf_id = '$id'";
		$data = mysql_query($query);
		return $data;
	}
	
	function insert($title, $content, $link, $visible) {
		$query = "insert into dt_pdf (pdf_title, pdf_content, pdf_link, pdf_visible) values ('$title', '$content', '$link', '$visible')";
		mysql_query($query);
	}
	
	function update($id, $title, $content, $link, $visible) {
		$query = "update dt_pdf set pdf_title = '$title', pdf_content = '$content', pdf_link = '$link', pdf_visible = '$visible' where pdf_id = '$id'";
		mysql_query($query);
	}
	
	function delete($id) {
		$query = "delete from dt_pdf where pdf_id = '$id'";
		mysql_query($query);
	}
	
	function updateNOFile($id, $title, $content, $visible) {
		$query = "update dt_pdf set pdf_title = '$title', pdf_content = '$content', pdf_visible = '$visible' where pdf_id = '$id'";
		mysql_query($query);
	}
}
?>